home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-11-03 | 350 b | 16 lines | [TEXT/KEEN] |
- # $SortTest - test the builtin sort command
-
-
- BEGIN { s = "apples:pears:oranges:bananas"
- n = split(s,a,":");
- print "original array:"
- for (i = 1; i <= n; ++i)
- print a[i]
- max = sort(a,ind,"d");#dictionary order
- print "now sorted:"
- print "max is", max
- for (i in ind)
- print i, ind[i]
- for (i = 1; i <= max; ++i)
- print a[ind[i]]
- }